<input id='field'/>
<script>
  var field = document.getElementById('field');
  field.focus();
  field.value = 'some text';
</script>
